import Vue from "vue"
import App from "@/App.vue"
import VueRouter from "vue-router"

// 引入组件
import Login from "@/views/user/Login"
import Home from '@/views/Home'

import Register from '@/views/user/Register'
import HelloWorld from '@/components/HelloWorld'

// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
	{
		name: "login",
		path: "/login",
		component: Login
	},
	{
	path: "/",
	name: "app",
	redirect: "/login",
	component: App,
	children:[
		{
			name: 'home',
			path: '/home',
			component: Home,
			children:[
				{
					name: 'register',
					path: '/home/register',
					component: Register
				}, {
					name: 'helloWorld',
					path: '/home/helloWorld',
					component: HelloWorld
				}, {
					name: 'anRoleLsit',
					path: '/home/anRoleLsit',
					component: () => import('@/views/account/AnRoleList'),
				}, 
			]
		},

	]
}]

var router = new VueRouter({
	routes
})
export default router;
